<script setup>
defineProps({
    control: Object,
    model: Object,
})
</script>

<template>
    <van-field
        :name="control.id"
        :label="control.props.label"
        :required="control.rules[0].required"
    >
        <template #input>
            <van-switch
                v-model="model[control.id]"
                :active-color="control.props.activeColor"
                :inactive-color="control.props.inactiveColor"
                size="20"
            />
        </template>
    </van-field>
</template>
